/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author bsmith
 */
@Entity
@Table(name = "merchantassociatedcategories")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Merchantassociatedcategories.findAll", query = "SELECT m FROM Merchantassociatedcategories m"),
    @NamedQuery(name = "Merchantassociatedcategories.findById", query = "SELECT m FROM Merchantassociatedcategories m WHERE m.id = :id"),
    @NamedQuery(name = "Merchantassociatedcategories.findByMerchantid", query = "SELECT m FROM Merchantassociatedcategories m WHERE m.merchantid = :merchantid"),
    @NamedQuery(name = "Merchantassociatedcategories.findByCategoryid", query = "SELECT m FROM Merchantassociatedcategories m WHERE m.categoryid = :categoryid")})
public class Merchantassociatedcategories implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "merchantid")
    private int merchantid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "categoryid")
    private int categoryid;

    public Merchantassociatedcategories() {
    }

    public Merchantassociatedcategories(Integer id) {
        this.id = id;
    }

    public Merchantassociatedcategories(Integer id, int merchantid, int categoryid) {
        this.id = id;
        this.merchantid = merchantid;
        this.categoryid = categoryid;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getMerchantid() {
        return merchantid;
    }

    public void setMerchantid(int merchantid) {
        this.merchantid = merchantid;
    }

    public int getCategoryid() {
        return categoryid;
    }

    public void setCategoryid(int categoryid) {
        this.categoryid = categoryid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Merchantassociatedcategories)) {
            return false;
        }
        Merchantassociatedcategories other = (Merchantassociatedcategories) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jpa.entities.Merchantassociatedcategories[ id=" + id + " ]";
    }
    
}
